package com.cloudloan.controller;

import com.cloudloan.common.R;
import com.cloudloan.entity.User;
import com.cloudloan.service.LoginServcie;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user")
@Api(value = "用户服务",tags = "用户服务")
public class LoginController {
    @Autowired
    private LoginServcie loginServcie;
    @PostMapping("/login")
    @ApiOperation("web端登录接口")
    public R login(@RequestBody User user){
        return loginServcie.login(user);
    }

    /**
     * 退出登录
     * @return
     */
    @GetMapping("/loginOut")
    public R logout(){
        return loginServcie.logout();
    }

}
